package com.example.demo.application.impl;

import com.example.demo.application.OrderSplitService;
import com.example.demo.domain.entity.OrderInfo;
import org.springframework.stereotype.Service;

/**
 * 订单分摊实现类
 *
 * @author ouchengchang
 */
@Service
public class OrderSplitServiceImpl implements OrderSplitService {

    @Override
    public void calcOrderSplitResult(OrderInfo orderInfo) {
        // 计算订单总金额
        orderInfo.calcTotalOrderAmount();

        // 输出订单信息
        orderInfo.displayOrderInfo();

        // 计算订单明细分摊结果
        orderInfo.calcOrderDetailPayAmount();

        // 输出分摊结果
        orderInfo.displayOrderSplitInfo();
    }

}
